home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1993 July / InfoMagic USENET CD-ROM July 1993.ISO / sources / misc / volume16 / ecu3 / part18 < prev    next >
Encoding:
Internet Message Format  |  1991-01-06  |  23.9 KB

  1. From: wht@n4hgf.uucp (Warren Tucker)
  2. Newsgroups: comp.sources.misc
  3. Subject: v16i042:  ECU async comm package rev 3.0, Part18/35
  4. Message-ID: <1991Jan6.052332.28198@sparky.IMD.Sterling.COM>
  5. Date: 6 Jan 91 05:23:32 GMT
  6. Approved: kent@sparky.imd.sterling.com
  7. X-Checksum-Snefru: 9f0deb41 fcb8c533 2d5dfd48 a900d5be
  8.  
  9. Submitted-by: wht@n4hgf.uucp (Warren Tucker)
  10. Posting-number: Volume 16, Issue 42
  11. Archive-name: ecu3/part18
  12.  
  13. ---- Cut Here and feed the following to sh ----
  14. #!/bin/sh
  15. # This is part 18 of ecu3
  16. if touch 2>&1 | fgrep 'amc' > /dev/null
  17.  then TOUCH=touch
  18.  else TOUCH=true
  19. fi
  20. # ============= ecuungetty/ecuungetty.c ==============
  21. if test ! -d 'ecuungetty'; then
  22.     echo 'x - creating directory ecuungetty'
  23.     mkdir 'ecuungetty'
  24. fi
  25. echo 'x - extracting ecuungetty/ecuungetty.c (Text)'
  26. sed 's/^X//' << 'SHAR_EOF' > 'ecuungetty/ecuungetty.c' &&
  27. X/*+-------------------------------------------------------------------------
  28. X    ecuungetty.c - ecu "ungetty" program
  29. X    wht%n4hgf@gatech.edu
  30. X
  31. Xecuungetty /dev/ttyxx <bamboozle-str>
  32. Xecuungetty -t /dev/ttyxx <bamboozle-str>
  33. Xecuungetty -r /dev/ttyxx <bamboozle-str>
  34. X
  35. X  Defined functions:
  36. X    ecu_log_event(pid,logstr)
  37. X    errno_text(errnum)
  38. X    hangup()
  39. X    main(argc,argv,envp)
  40. X
  41. X--------------------------------------------------------------------------*/
  42. X/*+:EDITS:*/
  43. X/*:09-19-1990-19:36-wht@n4hgf-ecu_log_event now gets pid for log from caller */
  44. X/*:08-14-1990-20:40-wht@n4hgf-ecu3.00-flush old edit history */
  45. X
  46. X#include <stdio.h>
  47. X#include <ctype.h>
  48. X#include <fcntl.h>
  49. X#include <errno.h>
  50. X#include <signal.h>
  51. X#include <sys/types.h>
  52. X#include <sys/stat.h>
  53. X#include <utmp.h>
  54. X#include "../stdio_lint.h"
  55. X#include "../ecuungetty.h"
  56. X#include "../utmpstatus.h"
  57. X
  58. Xextern struct utmp last_utmp;
  59. X
  60. X/*+-------------------------------------------------------------------------
  61. X    ecu_log_event(pid,logstr) - dummy procedure for utmpstat.o
  62. X--------------------------------------------------------------------------*/
  63. Xvoid
  64. Xecu_log_event(pid,logstr)
  65. Xint pid;
  66. Xchar *logstr;
  67. X{
  68. X    ;
  69. X}    /* end of ecu_log_event */
  70. X
  71. X/*+-------------------------------------------------------------------------
  72. X    hangup() - "dummy" for utmpstat.c
  73. XThis particular incantation will only be called if utmp is non-existent
  74. Xor not readable.......
  75. X--------------------------------------------------------------------------*/
  76. Xhangup()
  77. X{
  78. X    exit(UGE_NOTROOT);
  79. X}    /* end of hangup */
  80. X
  81. X/*+-------------------------------------------------------------------------
  82. X    errno_text(errnum)
  83. X--------------------------------------------------------------------------*/
  84. Xchar *
  85. Xerrno_text(errnum)
  86. Xint errnum;
  87. X{
  88. Xstatic char errstr[12];
  89. X    sprintf(errstr,"E%d\n",errnum);
  90. X    return(errstr);
  91. X}    /* end of errno_text */
  92. X
  93. X/*+-------------------------------------------------------------------------
  94. X    main(argc,argv,envp)
  95. X--------------------------------------------------------------------------*/
  96. Xmain(argc,argv,envp)
  97. Xint argc;
  98. Xchar **argv;
  99. Xchar **envp;
  100. X{
  101. Xint op = 'g';    /* assume "get" operation */
  102. Xint status;
  103. Xint itmp;
  104. Xchar *tty = argv[1];
  105. Xchar *bamboozlement = argv[2];
  106. Xchar *bamboozle();
  107. X
  108. X    if(geteuid() != 0)
  109. X        exit(UGE_NOTROOT);
  110. X
  111. X    if(*argv[1] == '-')
  112. X    {
  113. X        switch(op = *(argv[1] + 1))
  114. X        {
  115. X            case 'r':
  116. X            case 't':
  117. X                break;
  118. X            default:
  119. X                exit(UGE_BADSWITCH);
  120. X        }
  121. X        if(argc < 3)
  122. X            exit(UGE_BADARGC);
  123. X        tty = argv[2];
  124. X        bamboozlement = argv[3];
  125. X    }
  126. X    else if(argc <= 2)
  127. X        exit(UGE_BADARGC);
  128. X
  129. X    if(getuid() != 0)
  130. X    {
  131. X        if(strcmp(bamboozlement,bamboozle(getppid())))
  132. X            exit(UGE_CALLER);
  133. X    }
  134. X
  135. X    status = utmp_status(tty);
  136. X
  137. X    switch(op)
  138. X    {
  139. X        case 'g':
  140. X            switch(status)
  141. X            {
  142. X                case US_NOTFOUND:    /* not in utmp, or getty dead */
  143. X                    exit(UG_NOTENAB);
  144. X                case US_LOGIN:        /* enabled for login, idle */
  145. X                    kill(last_utmp.ut_pid,SIGUSR1);
  146. X                    nap(200L);
  147. X                    exit(UG_ENAB);
  148. X                case US_DIALOUT:    /* enabled for login, currently dialout */
  149. X                case US_LOGGEDIN:    /* enabled for login, in use */
  150. X                    exit(UG_FAIL);
  151. X            }
  152. X            break;
  153. X
  154. X        case 't':
  155. X            switch(status)
  156. X            {
  157. X                case US_NOTFOUND:    /* not in utmp, or getty dead */
  158. X                    exit(UGE_T_NOTFOUND);
  159. X                case US_LOGIN:        /* enabled for login, idle */
  160. X                    exit(UGE_T_LOGIN);
  161. X                case US_LOGGEDIN:    /* enabled for login, in use */
  162. X                    exit(UGE_T_LOGGEDIN);
  163. X                case US_DIALOUT:    /* enabled for login, currently dialout */
  164. X                    exit(UG_RESTART);
  165. X            }
  166. X            break;
  167. X
  168. X        case 'r':
  169. X            switch(status)
  170. X            {
  171. X                case US_NOTFOUND:    /* not in utmp, or getty dead */
  172. X                case US_LOGIN:        /* enabled for login, idle */
  173. X                case US_LOGGEDIN:    /* enabled for login, in use */
  174. X                    exit(0);
  175. X                case US_DIALOUT:    /* enabled for login, currently dialout */
  176. X                    itmp = 5;
  177. X                    while(itmp--)
  178. X                    {
  179. X                        if(kill(last_utmp.ut_pid,SIGUSR2))
  180. X                            break;
  181. X                        nap(100L);
  182. X                    }
  183. X                    exit(0);
  184. X            }
  185. X            break;
  186. X    }
  187. X    exit(0);
  188. X}    /* end of main */
  189. X
  190. X/* vi: set tabstop=4 shiftwidth=4: */
  191. X/* end of ecuungetty.c */
  192. SHAR_EOF
  193. $TOUCH -am 0919193690 'ecuungetty/ecuungetty.c' &&
  194. chmod 0644 ecuungetty/ecuungetty.c ||
  195. echo 'restore of ecuungetty/ecuungetty.c failed'
  196. Wc_c="`wc -c < 'ecuungetty/ecuungetty.c'`"
  197. test 3923 -eq "$Wc_c" ||
  198.     echo 'ecuungetty/ecuungetty.c: original size 3923, current size' "$Wc_c"
  199. # ============= mapkey/README ==============
  200. if test ! -d 'mapkey'; then
  201.     echo 'x - creating directory mapkey'
  202.     mkdir 'mapkey'
  203. fi
  204. echo 'x - extracting mapkey/README (Text)'
  205. sed 's/^X//' << 'SHAR_EOF' > 'mapkey/README' &&
  206. XThis file contains information necessary to map ALT-A through ALT-Z
  207. Xin accordance with ecuxkey.h to produce unique codes so that
  208. XALT-[A-Z] can cause ECU to execute procedures with a single keystroke.
  209. X
  210. XModify your /usr/lib/keyboard/keys value for the ALT values for
  211. Xkey codes matching keys [a-z] as follows:
  212. X
  213. X                                ALT-unshifted
  214. X                                     |
  215. X                                     V
  216. X
  217. X    16    'q'    'Q'    dc1    dc1    144    'Q'      dc1     dc1     C
  218. X    17    'w'    'W'    etb    etb    150       'W'      etb     etb     C
  219. X    18    'e'    'E'    enq    enq    132       'E'      enq     enq     C
  220. X    19    'r'    'R'    dc2    dc2    145       'R'      dc2     dc2     C
  221. X    20    't'    'T'    dc4    dc4    147       'T'      dc4     dc4     C
  222. X    21    'y'    'Y'    em     em        152       'Y'      em     em     C
  223. X    22    'u'    'U'    nak    nak    148       'U'      nak     nak     C
  224. X    23    'i'    'I'    ht     ht        136       'I'      ht     ht     C
  225. X    24    'o'    'O'    si     si        142       'O'      si     si     C
  226. X    25    'p'    'P'    dle    dle    143       'P'      dle     dle     C
  227. X    30    'a'    'A'    soh    soh    128       'A'      soh     soh     C
  228. X    31    's'    'S'    dc3    dc3    146       'S'      dc3     dc3     C
  229. X    32    'd'    'D'    eot    eot    131       'D'      eot     eot     C
  230. X    33    'f'    'F'    ack    ack    133       'F'      ack     ack     C
  231. X    34    'g'    'G'    bel    bel    134       'G'      bel     bel     C
  232. X    35    'h'    'H'    bs     bs        135       'H'      bs     bs     C
  233. X    36    'j'    'J'    nl     nl        137       'J'      nl     nl     C
  234. X    37    'k'    'K'    vt     vt        138       'K'      vt     vt     C
  235. X    38    'l'    'L'    np     np        139       'L'      np     np     C
  236. X    44    'z'    'Z'    sub    sub    153       'Z'      sub     sub     C
  237. X    45    'x'    'X'    can    can    151       'X'      can     can     C
  238. X    46    'c'    'C'    etx    etx    130       'C'      etx     etx     C
  239. X    47    'v'    'V'    syn    syn    149       'V'      syn     syn     C
  240. X    48    'b'    'B'    stx    stx    129       'B'      stx     stx     C
  241. X    49    'n'    'N'    so     so        141       'N'      so     so     C
  242. X    50    'm'    'M'    cr     cr        140       'M'      cr     cr     C
  243. X
  244. X
  245. XA diff file for at.ibm.usa is supplied in keys.usa.ecu.d
  246. X
  247. X
  248. Xvi fodder:
  249. Xvi:set ts=8:
  250. SHAR_EOF
  251. $TOUCH -am 0509094590 'mapkey/README' &&
  252. chmod 0644 mapkey/README ||
  253. echo 'restore of mapkey/README failed'
  254. Wc_c="`wc -c < 'mapkey/README'`"
  255. test 2060 -eq "$Wc_c" ||
  256.     echo 'mapkey/README: original size 2060, current size' "$Wc_c"
  257. # ============= mapkey/keys.usa.ecu.d ==============
  258. echo 'x - extracting mapkey/keys.usa.ecu.d (Text)'
  259. sed 's/^X//' << 'SHAR_EOF' > 'mapkey/keys.usa.ecu.d' &&
  260. XThe mapkey files are marked Confidential :-/, so diffs are supplied.
  261. X
  262. X*** /usr/lib/keyboard/at.ibm.usa    Sat Jun 17 00:23:55 1989
  263. X--- keys.usa.ecu    Wed May  9 09:42:18 1990
  264. X***************
  265. X*** 39,54
  266. X      13    '='    '+'    nop    nop    '='       '+'      nop     nop     O
  267. X      14    bs     bs     del    del    bs       bs      del     del     O
  268. X      15    ht     btab   nop    nop    ht       btab      nop     nop     O
  269. X!     16    'q'    'Q'    dc1    dc1    'q'       'Q'      dc1     dc1     C
  270. X!     17    'w'    'W'    etb    etb    'w'       'W'      etb     etb     C
  271. X!     18    'e'    'E'    enq    enq    'e'       'E'      enq     enq     C
  272. X!     19    'r'    'R'    dc2    dc2    'r'       'R'      dc2     dc2     C
  273. X!     20    't'    'T'    dc4    dc4    't'       'T'      dc4     dc4     C
  274. X!     21    'y'    'Y'    em     em        'y'       'Y'      em     em     C
  275. X!     22    'u'    'U'    nak    nak    'u'       'U'      nak     nak     C
  276. X!     23    'i'    'I'    ht     ht        'i'       'I'      ht     ht     C
  277. X!     24    'o'    'O'    si     si        'o'       'O'      si     si     C
  278. X!     25    'p'    'P'    dle    dle    'p'       'P'      dle     dle     C
  279. X      26    '['    '{'    esc    esc    '['       '{'      esc     esc     O
  280. X      27    ']'    '}'    gs     gs        ']'       '}'      gs     gs     O
  281. X      28    cr     cr     nl     nl        cr       cr      nl     nl     O
  282. X
  283. X--- 39,54 -----
  284. X      13    '='    '+'    nop    nop    '='       '+'      nop     nop     O
  285. X      14    bs     bs     del    del    bs       bs      del     del     O
  286. X      15    ht     btab   nop    nop    ht       btab      nop     nop     O
  287. X!     16    'q'    'Q'    dc1    dc1    144    'Q'      dc1     dc1     C
  288. X!     17    'w'    'W'    etb    etb    150       'W'      etb     etb     C
  289. X!     18    'e'    'E'    enq    enq    132       'E'      enq     enq     C
  290. X!     19    'r'    'R'    dc2    dc2    145       'R'      dc2     dc2     C
  291. X!     20    't'    'T'    dc4    dc4    147       'T'      dc4     dc4     C
  292. X!     21    'y'    'Y'    em     em        152       'Y'      em     em     C
  293. X!     22    'u'    'U'    nak    nak    148       'U'      nak     nak     C
  294. X!     23    'i'    'I'    ht     ht        136       'I'      ht     ht     C
  295. X!     24    'o'    'O'    si     si        142       'O'      si     si     C
  296. X!     25    'p'    'P'    dle    dle    143       'P'      dle     dle     C
  297. X      26    '['    '{'    esc    esc    '['       '{'      esc     esc     O
  298. X      27    ']'    '}'    gs     gs        ']'       '}'      gs     gs     O
  299. X      28    cr     cr     nl     nl        cr       cr      nl     nl     O
  300. X***************
  301. X*** 53,67
  302. X      27    ']'    '}'    gs     gs        ']'       '}'      gs     gs     O
  303. X      28    cr     cr     nl     nl        cr       cr      nl     nl     O
  304. X      29    lctrl  lctrl  lctrl  lctrl  lctrl  lctrl  lctrl     lctrl     O
  305. X!     30    'a'    'A'    soh    soh    'a'       'A'      soh     soh     C
  306. X!     31    's'    'S'    dc3    dc3    's'       'S'      dc3     dc3     C
  307. X!     32    'd'    'D'    eot    eot    'd'       'D'      eot     eot     C
  308. X!     33    'f'    'F'    ack    ack    'f'       'F'      ack     ack     C
  309. X!     34    'g'    'G'    bel    bel    'g'       'G'      bel     bel     C
  310. X!     35    'h'    'H'    bs     bs        'h'       'H'      bs     bs     C
  311. X!     36    'j'    'J'    nl     nl        'j'       'J'      nl     nl     C
  312. X!     37    'k'    'K'    vt     vt        'k'       'K'      vt     vt     C
  313. X!     38    'l'    'L'    np     np        'l'       'L'      np     np     C
  314. X      39    ';'    ':'    nop    nop    ';'       ':'      nop     nop     O
  315. X      40    '\''   '"'    nop    nop    '\''   '"'      nop     nop     O
  316. X      41    '`'    '~'    nop    nop    '`'       '~'      nop     nop     O
  317. X
  318. X--- 53,67 -----
  319. X      27    ']'    '}'    gs     gs        ']'       '}'      gs     gs     O
  320. X      28    cr     cr     nl     nl        cr       cr      nl     nl     O
  321. X      29    lctrl  lctrl  lctrl  lctrl  lctrl  lctrl  lctrl     lctrl     O
  322. X!     30    'a'    'A'    soh    soh    128       'A'      soh     soh     C
  323. X!     31    's'    'S'    dc3    dc3    146       'S'      dc3     dc3     C
  324. X!     32    'd'    'D'    eot    eot    131       'D'      eot     eot     C
  325. X!     33    'f'    'F'    ack    ack    133       'F'      ack     ack     C
  326. X!     34    'g'    'G'    bel    bel    134       'G'      bel     bel     C
  327. X!     35    'h'    'H'    bs     bs        135       'H'      bs     bs     C
  328. X!     36    'j'    'J'    nl     nl        137       'J'      nl     nl     C
  329. X!     37    'k'    'K'    vt     vt        138       'K'      vt     vt     C
  330. X!     38    'l'    'L'    np     np        139       'L'      np     np     C
  331. X      39    ';'    ':'    nop    nop    ';'       ':'      nop     nop     O
  332. X      40    '\''   '"'    nop    nop    '\''   '"'      nop     nop     O
  333. X      41    '`'    '~'    nop    nop    '`'       '~'      nop     nop     O
  334. X***************
  335. X*** 67,79
  336. X      41    '`'    '~'    nop    nop    '`'       '~'      nop     nop     O
  337. X      42    lshift lshift lshift lshift lshift lshift lshift lshift     O
  338. X      43    '\\'   '|'    fs     fs        '\\'   '|'      fs     fs     O
  339. X!     44    'z'    'Z'    sub    sub    'z'       'Z'      sub     sub     C
  340. X!     45    'x'    'X'    can    can    'x'       'X'      can     can     C
  341. X!     46    'c'    'C'    etx    etx    'c'       'C'      etx     etx     C
  342. X!     47    'v'    'V'    syn    syn    'v'       'V'      syn     syn     C
  343. X!     48    'b'    'B'    stx    stx    'b'       'B'      stx     stx     C
  344. X!     49    'n'    'N'    so     so        'n'       'N'      so     so     C
  345. X!     50    'm'    'M'    cr     cr        'm'       'M'      cr     cr     C
  346. X      51    ','    '<'    nop    nop    ','       '<'      nop     nop     O
  347. X      52    '.'    '>'    nop    nop    '.'       '>'      nop     nop     O
  348. X      53    '/'    '?'    nop    nop    '/'       '?'      nop     nop     O
  349. X
  350. X--- 67,79 -----
  351. X      41    '`'    '~'    nop    nop    '`'       '~'      nop     nop     O
  352. X      42    lshift lshift lshift lshift lshift lshift lshift lshift     O
  353. X      43    '\\'   '|'    fs     fs        '\\'   '|'      fs     fs     O
  354. X!     44    'z'    'Z'    sub    sub    153       'Z'      sub     sub     C
  355. X!     45    'x'    'X'    can    can    151       'X'      can     can     C
  356. X!     46    'c'    'C'    etx    etx    130       'C'      etx     etx     C
  357. X!     47    'v'    'V'    syn    syn    149       'V'      syn     syn     C
  358. X!     48    'b'    'B'    stx    stx    129       'B'      stx     stx     C
  359. X!     49    'n'    'N'    so     so        141       'N'      so     so     C
  360. X!     50    'm'    'M'    cr     cr        140       'M'      cr     cr     C
  361. X      51    ','    '<'    nop    nop    ','       '<'      nop     nop     O
  362. X      52    '.'    '>'    nop    nop    '.'       '>'      nop     nop     O
  363. X      53    '/'    '?'    nop    nop    '/'       '?'      nop     nop     O
  364. SHAR_EOF
  365. $TOUCH -am 0509094390 'mapkey/keys.usa.ecu.d' &&
  366. chmod 0644 mapkey/keys.usa.ecu.d ||
  367. echo 'restore of mapkey/keys.usa.ecu.d failed'
  368. Wc_c="`wc -c < 'mapkey/keys.usa.ecu.d'`"
  369. test 5709 -eq "$Wc_c" ||
  370.     echo 'mapkey/keys.usa.ecu.d: original size 5709, current size' "$Wc_c"
  371. # ============= bperr/bperr.c ==============
  372. if test ! -d 'bperr'; then
  373.     echo 'x - creating directory bperr'
  374.     mkdir 'bperr'
  375. fi
  376. echo 'x - extracting bperr/bperr.c (Text)'
  377. sed 's/^X//' << 'SHAR_EOF' > 'bperr/bperr.c' &&
  378. X/*+-------------------------------------------------------------------------
  379. X    bperr.c - build proc_error .c from ecuerror.h
  380. X    wht%n4hgf@gatech.edu
  381. X--------------------------------------------------------------------------*/
  382. X/*+:EDITS:*/
  383. X/*:08-14-1990-20:39-wht@n4hgf-ecu3.00-flush old edit history */
  384. X
  385. X#include <stdio.h>
  386. X#include <time.h>
  387. X#include "../stdio_lint.h"
  388. X
  389. X#define MAXLINE 256
  390. X#define MAXFLDS 50
  391. X
  392. Xchar *strchr();
  393. X
  394. Xchar line[MAXLINE];
  395. Xchar copy[MAXLINE];
  396. Xchar *fields[MAXFLDS + 1];
  397. X
  398. Xchar *bc = 
  399. X"/*+-------------------------------------------------------------------------";
  400. Xchar *ec = 
  401. X"--------------------------------------------------------------------------*/";
  402. X/*+-------------------------------------------------------------------------
  403. X    splitter(sep)
  404. X--------------------------------------------------------------------------*/
  405. Xsplitter(sep)
  406. Xchar *sep;
  407. X{
  408. Xchar *tmp = copy;
  409. Xregister int fld;
  410. X
  411. X    for (fld = 1; fld <= MAXFLDS; fld++)
  412. X        fields[fld] = NULL;
  413. X    if (!strlen(sep) || !strlen(line))
  414. X        return(0);
  415. X    fld = 1;
  416. X    sprintf(copy, "%s", line);
  417. X    while (fld < MAXFLDS)
  418. X    {
  419. X        while (strchr(sep, *tmp))
  420. X            if (!*++tmp) return fld;
  421. X        fields[fld++] = tmp++;
  422. X        while (!strchr(sep, *tmp))
  423. X            if (!*++tmp) return fld;
  424. X        *tmp++ = '\0';
  425. X    }
  426. X    return(fld);
  427. X}    /* end of splitter */
  428. X
  429. X/*+-------------------------------------------------------------------------
  430. X    main(argc,argv)
  431. X--------------------------------------------------------------------------*/
  432. Xmain(argc,argv)
  433. Xint argc;
  434. Xchar **argv;
  435. X{
  436. Xregister field_count;
  437. Xregister itmp;
  438. Xlong time();
  439. Xstruct tm *localtime();
  440. Xlong cur_time;
  441. Xstruct tm *ltime;
  442. XFILE *fp;
  443. Xchar cmd[256];
  444. X
  445. X    freopen("proc_error.c","w",stdout);
  446. X
  447. X    puts(bc);
  448. X    puts("\tproc_error.c - print ecu procedure error");
  449. X    puts(ec);
  450. X    puts("/*+:EDITS:*/");
  451. X
  452. X    cur_time = time((long *)0);
  453. X    ltime = localtime(&cur_time);
  454. X    printf(
  455. X    "/*:%02d-%02d-%04d-%02d:%02d-build_err-creation from ecuerror.h */\n",
  456. X        ltime->tm_mon+1,ltime->tm_mday,ltime->tm_year + 1900,
  457. X        ltime->tm_hour,ltime->tm_min);
  458. X    puts("");
  459. X    puts("#include \"ecu.h\"");
  460. X    puts("#include \"ecuerror.h\"");
  461. X    puts("");
  462. X    puts(bc);
  463. X    puts("\tproc_error(erc) - print error message");
  464. X    puts(ec);
  465. X    puts("void");
  466. X    puts("proc_error(erc)");
  467. X    puts("int erc;");
  468. X    puts("{");
  469. X    puts("\tswitch(erc)");
  470. X    puts("\t{");
  471. X
  472. X    for(itmp = 0; itmp <= MAXFLDS; itmp++)
  473. X        fields[itmp] = NULL;
  474. X
  475. X    fp = fopen("ecuerror.h","r");
  476. X
  477. X    while(fgets(line,sizeof(line),fp))
  478. X    {
  479. X        line[strlen(line) - 1] = 0;
  480. X        fields[0] = line;
  481. X        field_count = splitter(" \t");
  482. X        if(!field_count || (strcmp(fields[1],"#define")))
  483. X            continue;
  484. X        if((!strcmp(fields[2],"eFATAL_ALREADY")) ||
  485. X            (!strcmp(fields[2],"eWARNING_ALREADY")) ||
  486. X            (!strncmp(fields[2],"e_",2)))
  487. X            continue;
  488. X        printf("\t\tcase %s:\n",fields[2]);
  489. X        fputs("\t\t\tpputs(\"",stdout);
  490. X
  491. X        for(itmp = 1; itmp < field_count - 1; itmp++)
  492. X            if(!strcmp(fields[itmp],"/*"))
  493. X                break;
  494. X        itmp++;
  495. X
  496. X        for(; itmp < field_count - 1; itmp++)
  497. X        {
  498. X            fputs(fields[itmp],stdout);
  499. X            if(itmp != field_count - 2)
  500. X                fputc(' ',stdout);
  501. X        }
  502. X        fputs("\\n\");\n",stdout);
  503. X        puts("\t\t\tbreak;");
  504. X    }
  505. X    puts("\t\tcase eFATAL_ALREADY:");
  506. X    puts("\t\tcase eWARNING_ALREADY:");
  507. X    puts("\t\t\tbreak;");
  508. X    puts("\t\tdefault:");
  509. X    puts("\t\t\tpprintf(\"unknown error %x\\n\",erc);");
  510. X    puts("\t\t\tbreak;");
  511. X
  512. X    puts("\t}");
  513. X    puts("} /* end of proc_error */\n");
  514. X    puts("/* vi: set tabstop=4 shiftwidth=4: */");
  515. X    puts("/* end of proc_error.c */");
  516. X    freopen("/dev/tty","a",stdout);
  517. X    sprintf(cmd,"fcrc -u proc_error.c");
  518. X    system(cmd);
  519. X    exit(0);
  520. X}    /* end of main */
  521. X
  522. X/* vi: set tabstop=4 shiftwidth=4: */
  523. X/* end of bperr.c */
  524. SHAR_EOF
  525. $TOUCH -am 0814204290 'bperr/bperr.c' &&
  526. chmod 0644 bperr/bperr.c ||
  527. echo 'restore of bperr/bperr.c failed'
  528. Wc_c="`wc -c < 'bperr/bperr.c'`"
  529. test 3558 -eq "$Wc_c" ||
  530.     echo 'bperr/bperr.c: original size 3558, current size' "$Wc_c"
  531. # ============= z/Makefile ==============
  532. if test ! -d 'z'; then
  533.     echo 'x - creating directory z'
  534.     mkdir 'z'
  535. fi
  536. echo 'x - extracting z/Makefile (Text)'
  537. sed 's/^X//' << 'SHAR_EOF' > 'z/Makefile' &&
  538. X#  CHK=0xC8A5
  539. X#+-------------------------------------------------------------------
  540. X# Makefile for ecurz/ecusz (ecu file transfer)
  541. X#--------------------------------------------------------------------
  542. X#+:EDITS:*/
  543. X#:05-07-1990-21:21-wht@n4hgf-omit fcrc usage in release makes
  544. X#:01-03-1990-15:30-wht-quit using -Ox --- Oi screws up too much
  545. X#:11-23-1989-02:37-wht-start support for UNIX V/386
  546. X#:10-11-1989-18:46-wht-needed more work to get makes to work away from my system
  547. X#:07-03-1989-22:58-wht------ x2.00 -----
  548. X#:05-08-1989-16:51-wht-rename files, solidify make procedure
  549. X#:01-11-1989-21:00-wht-change over to 386
  550. X
  551. XSHELL = /bin/sh
  552. X
  553. X.SUFFIXES: .o .c .h  
  554. X
  555. XSYSTEM = `sysdep =M_UNIX UNIX Sys V/386 =M_I386 Xenix/386 =M_I286 Xenix/286`
  556. XCOMFLAGS = -i `sysdep =M_I386 -Octl -CSON  =M_I286 -M2le -O -F 1000 -LARGE`
  557. XCFLAGS = -c $(EXTRA) $(COMFLAGS) -DMD -DLINT_ARGS -DREADCHECK -DLOG_XFER -DM_TERMCAP
  558. X
  559. XLDFLAGS = -ltcap -ltermlib -lx
  560. X
  561. XCOMMON_SRC = \
  562. X    zcommon.c\
  563. X    zmodem.c\
  564. X    zcurses.c\
  565. X    baudtest.c\
  566. X    zdebug.c
  567. X
  568. XCOMMON_OBJ = \
  569. X    zcommon.o\
  570. X    zmodem.o\
  571. X    zcurses.o\
  572. X    baudtest.o\
  573. X    ../logevent.o
  574. X
  575. X.c.o:;    cc $(CFLAGS) $*.c
  576. X
  577. Xall: ecusz ecurz
  578. X
  579. Xecusz: ecusz.o $(COMMON_OBJ)
  580. X    echo 'char *makedate="'`date` $(SYSTEM)'";'  >ecuszmake.c
  581. X    cc $(CFLAGS) ecuszmake.c ; rm ecuszmake.c
  582. X    cc $(COMFLAGS) ecusz.o ecuszmake.o $(COMMON_OBJ) $(LDFLAGS) -o ecusz
  583. X    rm -f ecuszmake.o
  584. X
  585. Xecurz: ecurz.o $(COMMON_OBJ)
  586. X    echo 'char *makedate="'`date` $(SYSTEM)'";'  >ecurzmake.c
  587. X    cc $(CFLAGS) ecurzmake.c ; rm ecurzmake.c
  588. X    cc $(COMFLAGS) ecurz.o ecurzmake.o $(COMMON_OBJ) $(LDFLAGS) -o ecurz 
  589. X    rm -f ecurzmake.o
  590. X
  591. Xcomsrc.fls: $(COMMON_SRC) Makefile
  592. X    ls $(COMMON_SRC) > comsrc.fls
  593. X
  594. Xlint: zlint.h
  595. X
  596. Xzlint.h: comsrc.fls 
  597. X    echo ' ' > zlint.h
  598. X    csh ../zgcc comsrc.fls zlint.h $(CFLAGS)
  599. X
  600. X../logevent.o:
  601. X    cd ..;make logevent.o
  602. X
  603. X#
  604. X# MAKE DEPEND: regenerate .c:.h, .ol:.c, .ol:.asm dependencies automatically
  605. X#
  606. Xdepend:
  607. X        rm -f depend.tmp
  608. X        if test '$(COMMON_SRC)' ;\
  609. X        then (grep '^#include' $(COMMON_SRC) \
  610. X        | sed    -e 's?:[^<]*<\([^>]*\)>.*?: /usr/include/\1?'\
  611. X            -e 's?:[^"]*"\([^"]*\)".*?: \1?'\
  612. X            -e 's?\(.*\)\.c?\1.o?'\
  613. X         >> depend.tmp) ;\
  614. X        fi
  615. X
  616. X        echo '/^# DO NOT DELETE THIS LINE' >exdep.tmp
  617. X        echo '.+1,$$d' >>exdep.tmp
  618. X        echo 'r depend.tmp' >> exdep.tmp
  619. X        echo 'w' >> exdep.tmp
  620. X        cp Makefile Makefile.new
  621. X        ex Makefile.new < exdep.tmp
  622. X        rm exdep.tmp depend.tmp
  623. X        echo '#    DEPENDENCIES MUST END AT END OF    FILE' >>Makefile.new
  624. X        echo '#    IF YOU PUT STUFF HERE IT WILL GO AWAY'>>Makefile.new
  625. X        echo '#    see make depend    above'>>Makefile.new
  626. X        mv Makefile Makefile.bak
  627. X        mv Makefile.new Makefile
  628. X
  629. X# DO NOT DELETE THIS LINE
  630. Xzcommon.o: /usr/include/stdio.h
  631. Xzcommon.o: /usr/include/signal.h
  632. Xzcommon.o: /usr/include/setjmp.h
  633. Xzcommon.o: /usr/include/ctype.h
  634. Xzcommon.o: /usr/include/pwd.h
  635. Xzcommon.o: zmodem.h
  636. Xzcommon.o: /usr/include/fcntl.h
  637. Xzmodem.o: zmodem.h
  638. Xzcurses.o: /usr/include/curses.h
  639. Xzcurses.o: /usr/include/sys/types.h
  640. Xzcurses.o: /usr/include/sys/stat.h
  641. Xzcurses.o: /usr/include/ctype.h
  642. Xzcurses.o: /usr/include/signal.h
  643. Xzcurses.o: /usr/include/time.h
  644. Xzcurses.o: /usr/include/sys/timeb.h
  645. Xzcurses.o: ../pc_scr.h
  646. X#    DEPENDENCIES MUST END AT END OF    FILE
  647. X#    IF YOU PUT STUFF HERE IT WILL GO AWAY
  648. X#    see make depend    above
  649. SHAR_EOF
  650. $TOUCH -am 1204054090 'z/Makefile' &&
  651. chmod 0644 z/Makefile ||
  652. echo 'restore of z/Makefile failed'
  653. Wc_c="`wc -c < 'z/Makefile'`"
  654. test 3163 -eq "$Wc_c" ||
  655.     echo 'z/Makefile: original size 3163, current size' "$Wc_c"
  656. # ============= z/baudtest.c ==============
  657. echo 'x - extracting z/baudtest.c (Text)'
  658. sed 's/^X//' << 'SHAR_EOF' > 'z/baudtest.c' &&
  659. X
  660. X/*+-------------------------------------------------------------------------
  661. X    baudtest.c
  662. X    wht@n4hgf.Mt-Park.GA.US
  663. X
  664. XAlas, on some systems, curses insists on sgtty.h inclusion
  665. Xwhich does not get aslong with termio.h AT ALL
  666. X--------------------------------------------------------------------------*/
  667. X/*+:EDITS:*/
  668. X/*:12-04-1990-05:36-wht-creation */
  669. X
  670. X#include <stdio.h>
  671. X#include <sys/types.h>
  672. X#include <termio.h>
  673. X
  674. Xextern int iofd;
  675. Xextern int no_curses;
  676. Xextern int report_verbosity;
  677. Xextern int report_init_complete;
  678. Xextern char *numeric_revision;
  679. X
  680. X/*+-------------------------------------------------------------------------
  681. X    test_tty_and_line_baud()
  682. X
  683. X  if non-multiscreen tty baud rate not at least that
  684. X  of the attached line, use no curses, but do be a bit more
  685. X  verbose than if tty not char special
  686. X
  687. X--------------------------------------------------------------------------*/
  688. Xvoid
  689. Xtest_tty_and_line_baud()
  690. X{
  691. X    struct termio tty_termio;
  692. X    struct termio line_termio;
  693. X
  694. X    memset((char *)&tty_termio,0,sizeof(struct termio));
  695. X    memset((char *)&line_termio,0,sizeof(struct termio));
  696. X    if(ioctl(0,TCGETA,&tty_termio) || ioctl(iofd,TCGETA,&line_termio) ||
  697. X        ((tty_termio.c_cflag & CBAUD) < ((line_termio.c_cflag & CBAUD))))
  698. X    {
  699. X        fprintf(stderr,"%s %o %o\r\n",numeric_revision,
  700. X            (tty_termio.c_cflag & CBAUD), (line_termio.c_cflag & CBAUD));
  701. X        no_curses = 1;
  702. X        report_verbosity = 0;
  703. X        report_init_complete = 1;
  704. X    }
  705. X
  706. X}    /* end of test_tty_and_line_baud */
  707. X
  708. X/* vi: set tabstop=4 shiftwidth=4: */
  709. X/* end of baudtest.c */
  710. SHAR_EOF
  711. $TOUCH -am 1221154390 'z/baudtest.c' &&
  712. chmod 0644 z/baudtest.c ||
  713. echo 'restore of z/baudtest.c failed'
  714. Wc_c="`wc -c < 'z/baudtest.c'`"
  715. test 1509 -eq "$Wc_c" ||
  716.     echo 'z/baudtest.c: original size 1509, current size' "$Wc_c"
  717. true || echo 'restore of z/ecurz.c failed'
  718. echo End of part 18, continue with part 19
  719. exit 0
  720. --------------------------------------------------------------------
  721. Warren Tucker, TuckerWare emory!n4hgf!wht or wht@n4hgf.Mt-Park.GA.US
  722. Hacker Extraordinaire  d' async PADs,  pods,  proteins and protocols
  723.  
  724. exit 0 # Just in case...
  725. -- 
  726. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  727. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  728. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  729. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  730.